<template>
  <el-dialog title="合同进度" v-model="visible" width="35%" destroy-on-close>
    <el-form
      :model="form"
      ref="dialogForm"
      label-width="auto"
      label-position="right"
    >
      <el-timeline :reverse="false">
        <el-timeline-item
          v-for="(item, index) in progressData"
          :key="index"
          type="success"
          icon="el-icon-check"
        >
          {{ item.title }}，时间：{{ item.time }}
        </el-timeline-item>
      </el-timeline>
    </el-form>
  </el-dialog>
</template>
<script>

export default {
  data () {
    return {
      visible: false,
      form: {},
      progressData: null
    }
  },
  mounted () {

  },
  methods: {
    open (data) {
      this.visible = true
      this.form = data
      this.getProgress()
    },
    async getProgress () {
      let { data } = await this.$API.contract.getContractProgress.get({ id: this.form.id })
      this.progressData = data
    }
  }
}
</script>